package com.it13.utils.sendemail;

import javax.mail.PasswordAuthentication;

public class MyAuthenticator extends javax.mail.Authenticator
{
  private String userName = null;
  private String password = null;
 
  public void setUsername(String username)
  {
	  userName = username;
  }

  public void setUserpass(String userpass)
  {
	  password = userpass;
  }

  public MyAuthenticator()
  {
    super();
  }
  
  public MyAuthenticator(String username, String userpass)
  {
    super();
    setUsername(username);
    setUserpass(userpass);
  }
  //一定要有这个方法，它是在需要身份验证时自动被调用的
  public PasswordAuthentication getPasswordAuthentication()
  {
    return new PasswordAuthentication(userName,password);
  }
}

    